<%@page language="java" pageEncoding="UTF-8"%>    
<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="orest.front.achieve.GetOptionAction"%>
<%@ page import="orest.common.valueobject.*" %>
<%@ page import="orest.common.util.* "%>
<%@page import="java.net.*" %> 
<%@page import="java.util.*"%> 
<%@page import="orest.front.achieve.AchieveHandler"%>
<%@page import="net.ssta.core.db.Record"%>
<%@page import="net.ssta.core.db.RecordSet"%>

<%
	response.setHeader("ContentType","text/xml");  
    response.setHeader("Pragma","No-Cache");   
    response.setDateHeader("Expires",0);   
    response.setHeader("Cache-Control","No-Cache");  
%>

<%  
	String path = request.getContextPath();
	String keyword = request.getParameter("key");
	String kjcgType = request.getParameter("kjcgType");
	RecordSet flRecSet = AchieveHandler.getNewEnergyClassList();
	RecordSet t_flRecSet = new RecordSet();
	t_flRecSet.add(flRecSet);
    
    RecordSet temp_RecSet = new RecordSet();
    if(kjcgType!=null&&!kjcgType.equals("")){
    	for(int i=0;i<flRecSet.size();i++){
    		Record rcd = flRecSet.get(i);
    		 //OPTIONNAME
    		if(rcd.getString("OPTIONVALUE","").equals(kjcgType)){
    			if(rcd.getObjectValue("CHILDLIST")!=null){
    				temp_RecSet.add((RecordSet)rcd.getObjectValue("CHILDLIST"));
    			}
    		}
    	}
    	flRecSet = temp_RecSet;
    }
    
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <META http-equiv=x-ua-compatible content=ie=8 />
<title>科技成果－国家安科网</title>

<link href="<%=path%>/common1/css/layout.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/common1/css/user.css" rel="stylesheet" type="text/css" />

<script language = "javascript" src = "js/search.js" type = "text/javascript"></script>
<script language = "javascript" src = "js/setcondition.js" type = "text/javascript"></script>

<script type="text/javascript" src="<%=path%>/includes/styleBase/js/jquery.js"></script>

<script language="javascript">


//查看科技成果
function viewKjcg(kjcgid,kjcgname){
	window.open("<%=path%>/achieve1/info.jsp?kjcgid="+$.trim(kjcgid)+"&title="+$.trim(kjcgname));
}


//推荐科技成果
function load_tjkjcg(divid,http){
	$.ajax({
		type:"POST",
		url:http,
		error:function(msg)
		{
			//alert("操作失败，请重试！"+msg);
		},
	    success:function(data)
	    {
	    	var data = eval("("+data+")");
	    	//alert(data);
			var html="";
			var showcount = 10;
			var i=0;
			for(i=0;i<data.length&&i<showcount;i++){
				var kjcgname = data[i]['kjcgname'];
				html+="<li>";
				html+="<a href='#2012' style=\"width:100%\" onclick=\"viewKjcg('"+data[i]['kjcgid']+"')\">"+kjcgname.substring(0,20)+"</a></li>";
				//html+="<span>";
				//html+=data[i]['unitname'].substring(0,8);
				//html+="</span>";
			}
			for(var j=i;j<showcount;j++){
				html+="<li><a style=\"width:100%\" href=\"#\"></a></li>";
			}
			$("#"+divid).html(html);
		}
	});
}



//加载各种类型的科技成果DIV
function load_kjcg(kjcgType,divid){
		var http = "<%=path%>/front/AchieveServlet?method=getKjcgList&newEnergyClassType="+kjcgType;
		$.ajax({
			type:"POST",
			url:http,
			error:function(msg)
			{
				//alert("操作失败，请重试！"+msg);
			},
		    success:function(data)
		    {
		    	//alert(data);
		    	var data = eval("("+data+")");
				var html="";
				for(var i=0;i<data.length&&i<8;i++){
					html+="<li><a href=\"javascript:viewKjcg(\'"+data[i]['kjcgid']+"\',\'"+data[i]['kjcgname']+"\')\">";
					html+=data[i]['kjcgname'];
					html+="</a></li>";
				}
				$("#"+divid).html(html);
			}
		});
}


//加载一级分类的2级分类
function loadKjcgSubFl(divid,http){
		$.ajax({
			type:"POST",
			url:http,
			error:function(msg)
			{
				alert("操作失败，请重试！"+msg);
			},
		    success:function(data)
		    {
		    	var data = eval("("+data+")");
				var html="";
				for(var i=0;i<data.length;i++){
					html+="<div style=\"float:left;height:40px\"><img style=\"margin-left:8px;float:left;\" src=\"<%=path%>/common/images/search/icon.jpg\" />";
					html+="<div style=\"float:left;margin-top:10px;\"><a href=\"javascript:openKjcgFl('"+data[i]['optionvalue']+"\',\'"+data[i]['optionname']+"\');\">";
					html+=""+data[i]['optionname'];
					html+="</a></div></div>";
					if(i%3==0&&i>0){
						html+="</br>";
					}
				}
				$("#"+divid).html(html);
				//alert(html);
			}
		});
}





var topicname = "";
$("document").ready(function()
{

		//按键登录
		$("#item_3").keydown(function(e){ 
				 var curkey = e.which; 
				 if(curkey == 13){
					doSearch();
	       		 }
		});

        //加载推荐科技成果
		var http = "<%=path%>/front/AchieveServlet?method=getRecommendKjcgList&showType=ChannelShow";
		load_tjkjcg("zylist",http);
		
});




function moreKjcg(optName,morekey){
	window.location.href="<%=path%>/achieve1/search_results.jsp?"+morekey+"&topicname="+optName;
}



</script>	
<xml id="resultDom"></xml>
</head>

<body>

<%@include file="../common1/toplogin.jsp"%>
<%@include file="../common1/topbanner.jsp"%>
<%@include file="../common1/topmenu.jsp"%>






<!--页面主体部分-->
<div id="contentmain">
	
	
	
	<div id="all_content_right">
		<form id="searchform" name="searchform" action="<%=path%>/achieve1/search_results.jsp" method="post" >
		    <div id="topsearchbox_695">
					<ul>
						<li><img src="<%=path%>/common/images/search/icon.gif" /></li>
						<li><span class="bluetitle">关键字</span></li>
						<li>
							 <input type="text" style="width:0px;border:0px;" />
							 <input type="text" name="item_3" id="item_3" size="18" style="margin-top:4px;" />
							 <input type="hidden" name="topicname" id="topicname" value=""/>
		                 　   　<input type="hidden" name="key" id="key" value=""/>
						</li>
						<li> 
							<a id="sea_btn_bottom" href="javascript:javascript:doSearch();">
								<img  src="<%=path%>/common/images/search/botton1.gif" style="border:0px;margin-top:2px;"/>
							</a>
						</li>
						<li>
							<a href="<%=path%>/achieve1/advancedsearch.jsp" target="_self">高级搜索</a>
						</li>
						<li>
							<a href="<%=path%>/achieve1/needforachieve.jsp" target="_self">帮您找项目</a>
						</li>
					</ul>
			</div>
		</form>
		
		<%
			  String optValue_temp = "";
			  String optName_temp = "";
			  for(int i=0;i<t_flRecSet.size();i++){
				Record record = t_flRecSet.get(i);
				
				String optValue = record.getString("OPTIONVALUE","");
				String optName = record.getString("OPTIONNAME",""); 
				if(optValue.equals(kjcgType)){
					optValue_temp = kjcgType;
					optName_temp = optName;
				}
			}
		 %>
		
		
		<div id="border_box">
		
			<%if(optValue_temp.equals("")){ %>
		   		<div id="ind_title"><font>当前位置：<a href="/cms" class="blue">首页</a> > <a href="<%=path%>/achieve1/achieveIndex.jsp" class="blue">科技成果</a></font><span></span></div>
			<%}else{%>
				<div id="ind_title"><font>当前位置：<a href="/cms" class="blue">首页</a> > <a href="<%=path%>/achieve1/achieveIndex.jsp" class="blue">科技成果</a> > <a href="<%=path%>/achieve1/achieveIndex.jsp?kjcgType=<%=optValue_temp%>" class="blue"><%=optName_temp%></a></font><span></span></div>
			<%}%>
			
			
			<%
			  for(int i=0;i<flRecSet.size();i++){
				Record record = flRecSet.get(i);
				
				String optValue = record.getString("OPTIONVALUE","");
				String optName = record.getString("OPTIONNAME","");
				if(optValue.equals(kjcgType)){
					optValue_temp = kjcgType;
					optName_temp = optName;
				}
				
				String morekey = "";
				if(optValue.indexOf(".")==-1){
					morekey = "key=NewEnergyClass1="+optValue;
				}else{
					String strArr[] = optValue.split("\\.");
	        		String class1 = strArr[0];
					
	        		String class2 = strArr[1];
	        		morekey ="key=NewEnergyClass1="+class1+" AND NewEnergyClass2="+class2;
				}
			%>
				<div id="searchmain_box" style="height:auto;width:540px;padding-bottom:20px;">
				    <div id="ind_title_red">
				    	<%if(record.getObjectValue("CHILDLIST")!=null){%>
				    		<a href="<%=path%>/achieve1/achieveIndex.jsp?kjcgType=<%=optValue%>" target="_self" class="blue">
						    	<font><%=optName%></font>
						    </a>
				    	<%}else{%>
						    <a href="javascript:moreKjcg('<%=optName%>','<%=morekey%>');"  class="blue">
						    	<font><%=optName%></font>
						    </a>
					    <%}%>
					    <span>
					    <%if(record.getObjectValue("CHILDLIST")!=null){%>
						    <a href="<%=path%>/achieve1/achieveIndex.jsp?kjcgType=<%=optValue%>" target="_self" class="blue">
						   	 	更多
						    </a>
				    	<%}else{%>
						    <a href="javascript:moreKjcg('<%=optName%>','<%=morekey%>');" class="blue">
						   	 	更多
						    </a>
					    <%}%>
				    	</span>
				    </div>
					<ul class="ArticleLi" id="kjcgDiv_<%=i%>">
						<li><a href="#"></a></li>
						<li><a href="#"></a></li>
						<li><a href="#"></a></li>
						<li><a href="#"></a></li>
						<li><a href="#"></a></li>
					</ul>
				</div>
				<script>
					load_kjcg('<%=optValue%>','kjcgDiv_<%=i%>');
					//alert('<%=optValue%>');
				</script>
			<%}%>
			
		</div>
		
	</div>
	
	
	<div id="all_content_left">
    	<%@include file="../common/adleft.jsp"%>
		<div id="border_box_orange">
		    <div id="ind_title_cont_righttitle"><a href="<%=path%>/achieve1/search_results.jsp?key=ChannelShow='1'&topicname=推荐成果" class="blue"><font>推荐成果</font></a><span><a href="<%=path%>/achieve1/search_results.jsp?key=ChannelShow='1'&topicname=推荐成果" class="blue">更多...</a></span></div>
			<ul id="zylist">
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
				<li><a href="#"></a></li>
			</ul>
		</div>
	</div>
</div>

<%@include file="../common/bottom.jsp"%>

</body>
</html>

